/*
 * @Author: mhb
 * @Date: 2021-07-28 11:18:35
 * @LastEditTime: 2022-05-11 17:37:36
 * @LastEditors: Please set LastEditors
 * @Description: bim模型接口
 * @FilePath: \cscec-pms-admin\src\api\bimIntegrate\bimModel.js
 */
import request from '@/utils/request'
import { unionApiUrl } from '../config'
const PREFIX = unionApiUrl + '/bimModel/'
const PREFIXTWO = unionApiUrl + '/bimModelVersion/'
const PREFIXTHREE = unionApiUrl + '/bimPortfolioModel/'
const PREFIXFour = unionApiUrl + '/bimSubModel/'

/**
 * bim模型分页
 */
export function getList(data) {
  return request({
    url: `${PREFIX}getPageBimModel`,
    method: 'post',
    data
  })
}
/**
 * 工程总计划-关联BIM模型构件
 */
export function insertBimProjectMasterModel(data) {
  return request({
    url: `${PREFIX}insertBimProjectMasterModel`,
    method: 'post',
    data
  })
}

/**
 * 工程总计划-获取所有日期模型数据
 */
export function getBimProjectMasterModelList(data) {
  return request({
    url: `${PREFIX}getBimProjectMasterModelList`,
    method: 'get',
    params: data
  })
}
/**
 * 工程总计划-节点查看已关联模型
 */
export function getBimProjectMasterModelByNodeId(data) {
  return request({
    url: `${PREFIX}getBimProjectMasterModelByNodeId`,
    method: 'get',
    params: data
  })
}

/**
 * bim模型图钉信息
 */
export function getBimThumbtackByModelId(data) {
  return request({
    url: `${PREFIX}getBimThumbtackAllByModelId`,
    method: 'get',
    params: data
  })
}

/**
 * BIM图钉数据查询-实测实量点位
 */
export function getBimThumbtackActualBuAreaId(data) {
  return request({
    url: `${PREFIX}getBimThumbtackActualBuAreaId`,
    method: 'get',
    params: data
  })
}
/**
 * 新增bim模型
 */
export function addBimModel(data) {
  return request({
    url: `${PREFIX}insertSelective`,
    method: 'post',
    data
  })
}

/**
 * 更新bim模型
 */
export function editBimModel(data) {
  return request({
    url: `${PREFIX}updateByPrimaryKeySelective`,
    method: 'post',
    data
  })
}

/**
 * 获取bim模型详情
 */
export function getBimModelDetail(params) {
  return request({
    url: `${PREFIX}getBimModelById`,
    method: 'get',
    params
  })
}

/**
 * 删除bim模型
 */
export function deleteBimModel(params) {
  return request({
    url: `${PREFIX}deleteByPrimaryKey`,
    method: 'post',
    params
  })
}

/**
 * bim模型版本履历分页
 */
export function getBimModelVersion(data) {
  return request({
    url: `${PREFIXTWO}getPageBimModelVersion`,
    method: 'post',
    data
  })
}

/**
 * 新增bim模型版本履历
 */
export function addBimModelVersion(data) {
  return request({
    url: `${PREFIXTWO}insertSelective`,
    method: 'post',
    data
  })
}

/**
 * 删除bim模型
 */
export function deleteBimModelVersion(params) {
  return request({
    url: `${PREFIXTWO}deleteByPrimaryKey`,
    method: 'post',
    params
  })
}

/**
 * bim组合模型分页
 */
export function getBimPortfolioModel(data) {
  return request({
    url: `${PREFIXTHREE}getPageBimPortfolioModel`,
    method: 'post',
    data
  })
}

/**
 * 新增bim组合模型
 */
export function addBimPortfolioModel(data) {
  return request({
    url: `${PREFIXTHREE}insertSelective`,
    method: 'post',
    data
  })
}

/**
 * 删除bim组合模型
 */
export function deleteBimPortfolioModel(params) {
  return request({
    url: `${PREFIXTHREE}deleteByPrimaryKey`,
    method: 'post',
    params
  })
}

/**
 * bim组合模型明细分页
 */
export function getPageBimPortfolioModelMapper(data) {
  return request({
    url: `${unionApiUrl}/bimPortfolioModelMapper/getPageBimPortfolioModelMapper`,
    method: 'post',
    data
  })
}

/**
 * 关联BIM模型
 */
 export function associateBimModel(data) {
  return request({
    url: `${PREFIXFour}associateBimModel`,
    method: 'post',
    data
  })
}

/**
 * 查询已关联BIM模型
 */
export function getBimAssociateFloor(data) {
  return request({
    url: `${PREFIXFour}getBimAssociateFloor`,
    method: 'post',
    data
  })
}
